package com.pitaya.avatar.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.pitaya.avatar.dao.IHouseDAO;
import com.pitaya.avatar.domain.House;
import com.pitaya.avatar.service.IClusterService;
import com.pitaya.avatar.service.IHouseService;

public class HouseService implements IHouseService {

	private IHouseDAO houseDAO;
	private IClusterService clusterService;

	public IClusterService getClusterService() {
		return clusterService;
	}

	public void setClusterService(IClusterService clusterService) {
		this.clusterService = clusterService;
	}

	public void setHouseDAO(IHouseDAO houseDAO) {
		this.houseDAO = houseDAO;
	}
	
	public boolean add(House house) {
		return houseDAO.insert(house);
	}

	public List<House> find(House house) {
		return houseDAO.query(house);
	}

	public boolean remove(House house) {
		
		return houseDAO.delete(house);
	}

	public boolean renew(House house) {	
		return houseDAO.update(house);
	}
	
	public List<House> getHouseOfSchool(String school){
		//ToDo query data from database
		return new ArrayList<House>();
	}
	
}
